<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript">
		$(function(){

			$('#div1').closest('div').css({background:'red'});


		})
	</script>
</head>
<body>
	<div>
		<div id="div1"><a href="#">123</a></div>
		<div>456</div>
	</div>
</body>
</html>